package com.umakr.ax.core.filter;

/**
 * @author gx
 * @since 2017/5/24
 */
public class Pair<A,B> {
    public final A first;
    public final B second;
    public Pair(A a,B b){
        first=a;
        second=b;
    }

    @Override
    public String toString() {
        return "pair("+first+","+second+")";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Pair<?, ?> pair = (Pair<?, ?>) o;

        if (first != null ? !first.equals(pair.first) : pair.first != null) {
            return false;
        }
        return second != null ? second.equals(pair.second) : pair.second == null;

    }

    @Override
    public int hashCode() {
        int result = first != null ? first.hashCode() : 0;
        result = 31 * result + (second != null ? second.hashCode() : 0);
        return result;
    }
}
